﻿﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<ul class="nav nav-pills nav-stacked x-menu">
  <c:forEach var="menu" items="${secure.submenus[activeMenu]}">
     <c:if test="${currentPrincipal.hasResource('submenus', menu.id)}">
       <li class="menu-label"><div><i class="glyphicon glyphicon-${menu.icon} glyphicon-position-fix-2"></i>&nbsp;&nbsp;${menu.name}</div></li>
         <c:forEach var="submenu" items="${menu.submenus}">
           <c:if test="${currentPrincipal.hasResource('submenus', submenu.id)}">
             <li class="submenu ${menuContext.shouldHighlight(submenu.id) ? 'active' : ''}"><a href="${ctx.host}/${submenu.url}" title="${submenu.description}">${submenu.name}</a></li>
           </c:if>
         </c:forEach>
     </c:if>
  </c:forEach>
</ul>
